/*    */ package com.zimbra.cs.service.mail;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.common.soap.MailConstants;
/*    */ import com.zimbra.cs.mailbox.Mailbox;
/*    */ import com.zimbra.cs.mailbox.Metadata;
/*    */ import com.zimbra.cs.mailbox.OperationContext;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import java.util.Map;
/*    */ import java.util.Map.Entry;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetMailboxMetadata
/*    */   extends MailDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 33 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/* 34 */     Mailbox mbox = getRequestedMailbox(zsc);
/* 35 */     OperationContext octxt = getOperationContext(zsc, context);
/*    */     
/* 37 */     Element meta = request.getElement("meta");
/* 38 */     String section = meta.getAttribute("section");
/* 39 */     Metadata metadata = mbox.getConfig(octxt, section);
/*    */     
/* 41 */     Element response = zsc.createElement(MailConstants.GET_MAILBOX_METADATA_RESPONSE);
/* 42 */     meta = response.addElement("meta");
/* 43 */     meta.addAttribute("section", section);
/*    */     
/* 45 */     if (metadata != null) {
/* 46 */       for (Map.Entry<String, ?> entry : metadata.asMap().entrySet()) {
/* 47 */         meta.addKeyValuePair((String)entry.getKey(), entry.getValue().toString());
/*    */       }
/*    */     }
/*    */     
/* 51 */     return response;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/mail/GetMailboxMetadata.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */